\(\int \sqrt {a+a \sec (c+d x)} (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [360]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 34, antiderivative size = 62 \[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d} \]

[Out]

2/3*a*(3*B+C)*tan(d*x+c)/d/(a+a*sec(d*x+c))^(1/2)+2/3*C*(a+a*sec(d*x+c))^(1/2)*tan(d*x+c)/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.088, Rules used = {4139, 12, 3877} \[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a \sec (c+d x)+a}}+\frac {2 C \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 d} \]

[In]

Int[Sqrt[a + a*Sec[c + d*x]]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(2*a*(3*B + C)*Tan[c + d*x])/(3*d*Sqrt[a + a*Sec[c + d*x]]) + (2*C*Sqrt[a + a*Sec[c + d*x]]*Tan[c + d*x])/(3*d
)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3877

Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*b*(Cot[e + f*x]/(
f*Sqrt[a + b*Csc[e + f*x]])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4139

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) +
 (a_))^(m_.), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*((a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Dist[1/(b*(m + 1)
), Int[(a + b*Csc[e + f*x])^m*Simp[A*b*(m + 1) + (a*C*m + b*B*(m + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b
, e, f, A, B, C, m}, x] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)]

Rubi steps \begin{align*} \text {integral}& = \frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d}+\frac {2 \int \frac {1}{2} a (3 B+C) \sec (c+d x) \sqrt {a+a \sec (c+d x)} \, dx}{3 a} \\ & = \frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d}+\frac {1}{3} (3 B+C) \int \sec (c+d x) \sqrt {a+a \sec (c+d x)} \, dx \\ & = \frac {2 a (3 B+C) \tan (c+d x)}{3 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.69 \[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 a (3 B+2 C+C \sec (c+d x)) \tan (c+d x)}{3 d \sqrt {a (1+\sec (c+d x))}} \]

[In]

Integrate[Sqrt[a + a*Sec[c + d*x]]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(2*a*(3*B + 2*C + C*Sec[c + d*x])*Tan[c + d*x])/(3*d*Sqrt[a*(1 + Sec[c + d*x])])

Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.89

method result size
default \(\frac {2 \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (3 B \sin \left (d x +c \right )+2 C \sin \left (d x +c \right )+C \tan \left (d x +c \right )\right )}{3 d \left (\cos \left (d x +c \right )+1\right )}\) \(55\)
parts \(-\frac {2 B \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (\cot \left (d x +c \right )-\csc \left (d x +c \right )\right )}{d}+\frac {2 C \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (2 \sin \left (d x +c \right )+\tan \left (d x +c \right )\right )}{3 d \left (\cos \left (d x +c \right )+1\right )}\) \(78\)

[In]

int((B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2/3/d*(a*(1+sec(d*x+c)))^(1/2)/(cos(d*x+c)+1)*(3*B*sin(d*x+c)+2*C*sin(d*x+c)+C*tan(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.06 \[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \, {\left ({\left (3 \, B + 2 \, C\right )} \cos \left (d x + c\right ) + C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right )\right )}} \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

2/3*((3*B + 2*C)*cos(d*x + c) + C)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c)/(d*cos(d*x + c)^2 + d*
cos(d*x + c))

Sympy [F]

\[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (B + C \sec {\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)**2)*(a+a*sec(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a*(sec(c + d*x) + 1))*(B + C*sec(c + d*x))*sec(c + d*x), x)

Maxima [F]

\[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right )\right )} \sqrt {a \sec \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-2/3*((3*B*cos(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(2*d*x + 2*c) - (3*B*cos(2*d*x + 2*c) +
 3*B + 2*C)*sin(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2
 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sqrt(a) - 3*(((B + 2*C)*d*cos(2*d*x + 2*c)^2 + (B + 2*C)*d*sin(2*d*x + 2*c)^2
 + 2*(B + 2*C)*d*cos(2*d*x + 2*c) + (B + 2*C)*d)*integrate((((cos(6*d*x + 6*c)*cos(2*d*x + 2*c) + 2*cos(4*d*x
+ 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + sin(6*d*x + 6*c)*sin(2*d*x + 2*c) + 2*sin(4*d*x + 4*c)*sin(2*d*
x + 2*c) + sin(2*d*x + 2*c)^2)*cos(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) + (cos(2*d*x + 2*c)*sin(6*
d*x + 6*c) + 2*cos(2*d*x + 2*c)*sin(4*d*x + 4*c) - cos(6*d*x + 6*c)*sin(2*d*x + 2*c) - 2*cos(4*d*x + 4*c)*sin(
2*d*x + 2*c))*sin(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))))*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*
x + 2*c) + 1)) - ((cos(2*d*x + 2*c)*sin(6*d*x + 6*c) + 2*cos(2*d*x + 2*c)*sin(4*d*x + 4*c) - cos(6*d*x + 6*c)*
sin(2*d*x + 2*c) - 2*cos(4*d*x + 4*c)*sin(2*d*x + 2*c))*cos(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) -
 (cos(6*d*x + 6*c)*cos(2*d*x + 2*c) + 2*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + sin(6*d*x + 6
*c)*sin(2*d*x + 2*c) + 2*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(2*d*x + 2*c)^2)*sin(3/2*arctan2(sin(2*d*x + 2
*c), cos(2*d*x + 2*c))))*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/(((2*(2*cos(4*d*x + 4*c) +
cos(2*d*x + 2*c))*cos(6*d*x + 6*c) + cos(6*d*x + 6*c)^2 + 4*cos(4*d*x + 4*c)^2 + 4*cos(4*d*x + 4*c)*cos(2*d*x
+ 2*c) + cos(2*d*x + 2*c)^2 + 2*(2*sin(4*d*x + 4*c) + sin(2*d*x + 2*c))*sin(6*d*x + 6*c) + sin(6*d*x + 6*c)^2
+ 4*sin(4*d*x + 4*c)^2 + 4*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(2*d*x + 2*c)^2)*cos(1/2*arctan2(sin(2*d*x +
 2*c), cos(2*d*x + 2*c) + 1))^2 + (2*(2*cos(4*d*x + 4*c) + cos(2*d*x + 2*c))*cos(6*d*x + 6*c) + cos(6*d*x + 6*
c)^2 + 4*cos(4*d*x + 4*c)^2 + 4*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + 2*(2*sin(4*d*x + 4*c)
 + sin(2*d*x + 2*c))*sin(6*d*x + 6*c) + sin(6*d*x + 6*c)^2 + 4*sin(4*d*x + 4*c)^2 + 4*sin(4*d*x + 4*c)*sin(2*d
*x + 2*c) + sin(2*d*x + 2*c)^2)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2)*(cos(2*d*x + 2*c)^
2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)), x) + (B*d*cos(2*d*x + 2*c)^2 + B*d*sin(2*d*x + 2*c)^2
 + 2*B*d*cos(2*d*x + 2*c) + B*d)*integrate((((cos(6*d*x + 6*c)*cos(2*d*x + 2*c) + 2*cos(4*d*x + 4*c)*cos(2*d*x
 + 2*c) + cos(2*d*x + 2*c)^2 + sin(6*d*x + 6*c)*sin(2*d*x + 2*c) + 2*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(2
*d*x + 2*c)^2)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) + (cos(2*d*x + 2*c)*sin(6*d*x + 6*c) + 2*c
os(2*d*x + 2*c)*sin(4*d*x + 4*c) - cos(6*d*x + 6*c)*sin(2*d*x + 2*c) - 2*cos(4*d*x + 4*c)*sin(2*d*x + 2*c))*si
n(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))))*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) -
 ((cos(2*d*x + 2*c)*sin(6*d*x + 6*c) + 2*cos(2*d*x + 2*c)*sin(4*d*x + 4*c) - cos(6*d*x + 6*c)*sin(2*d*x + 2*c)
 - 2*cos(4*d*x + 4*c)*sin(2*d*x + 2*c))*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c))) - (cos(6*d*x + 6*
c)*cos(2*d*x + 2*c) + 2*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + sin(6*d*x + 6*c)*sin(2*d*x +
2*c) + 2*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(2*d*x + 2*c)^2)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x +
 2*c))))*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/(((2*(2*cos(4*d*x + 4*c) + cos(2*d*x + 2*c)
)*cos(6*d*x + 6*c) + cos(6*d*x + 6*c)^2 + 4*cos(4*d*x + 4*c)^2 + 4*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d
*x + 2*c)^2 + 2*(2*sin(4*d*x + 4*c) + sin(2*d*x + 2*c))*sin(6*d*x + 6*c) + sin(6*d*x + 6*c)^2 + 4*sin(4*d*x +
4*c)^2 + 4*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(2*d*x + 2*c)^2)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x
 + 2*c) + 1))^2 + (2*(2*cos(4*d*x + 4*c) + cos(2*d*x + 2*c))*cos(6*d*x + 6*c) + cos(6*d*x + 6*c)^2 + 4*cos(4*d
*x + 4*c)^2 + 4*cos(4*d*x + 4*c)*cos(2*d*x + 2*c) + cos(2*d*x + 2*c)^2 + 2*(2*sin(4*d*x + 4*c) + sin(2*d*x + 2
*c))*sin(6*d*x + 6*c) + sin(6*d*x + 6*c)^2 + 4*sin(4*d*x + 4*c)^2 + 4*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + sin(
2*d*x + 2*c)^2)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2)*(cos(2*d*x + 2*c)^2 + sin(2*d*x +
2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)), x))*sqrt(a))/(d*cos(2*d*x + 2*c)^2 + d*sin(2*d*x + 2*c)^2 + 2*d*cos(2
*d*x + 2*c) + d)

Giac [F]

\[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right )\right )} \sqrt {a \sec \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 17.74 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.56 \[ \int \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2\,\sqrt {\frac {a\,\left (\cos \left (c+d\,x\right )+1\right )}{\cos \left (c+d\,x\right )}}\,\left (6\,B\,\sin \left (c+d\,x\right )+6\,C\,\sin \left (c+d\,x\right )+6\,B\,\sin \left (2\,c+2\,d\,x\right )+6\,B\,\sin \left (3\,c+3\,d\,x\right )+3\,B\,\sin \left (4\,c+4\,d\,x\right )+8\,C\,\sin \left (2\,c+2\,d\,x\right )+6\,C\,\sin \left (3\,c+3\,d\,x\right )+2\,C\,\sin \left (4\,c+4\,d\,x\right )\right )}{3\,d\,\left (12\,\cos \left (c+d\,x\right )+8\,\cos \left (2\,c+2\,d\,x\right )+4\,\cos \left (3\,c+3\,d\,x\right )+\cos \left (4\,c+4\,d\,x\right )+7\right )} \]

[In]

int((B/cos(c + d*x) + C/cos(c + d*x)^2)*(a + a/cos(c + d*x))^(1/2),x)

[Out]

(2*((a*(cos(c + d*x) + 1))/cos(c + d*x))^(1/2)*(6*B*sin(c + d*x) + 6*C*sin(c + d*x) + 6*B*sin(2*c + 2*d*x) + 6
*B*sin(3*c + 3*d*x) + 3*B*sin(4*c + 4*d*x) + 8*C*sin(2*c + 2*d*x) + 6*C*sin(3*c + 3*d*x) + 2*C*sin(4*c + 4*d*x
)))/(3*d*(12*cos(c + d*x) + 8*cos(2*c + 2*d*x) + 4*cos(3*c + 3*d*x) + cos(4*c + 4*d*x) + 7))